<?php

class Languages_model extends CI_Model
{
	// Protected or private properties
	protected $_table;
	
	// Constructor
	public function __construct()
	{
		parent::__construct();
			
		$this->_table = $this->config->load('database_tables');
		//var_dump($this->_table);
	}
	
	// Public methods
	public function get_languages()
	{
		$this->db->select('*');
		
		$query = $this->db->get('site_language');
			
		if ($query->num_rows() > 0)
		{
			return $query->result_array();
		}
	}

	public function get_lang_id($code)
	{
		$this->db->select('*');
		$this->db->where('code', $code);
		$query = $this->db->get('site_language', 1);
			
		if ($query->num_rows() == 1)
		{
			$row = $query->row_array();
		}
		return $row;
	}
}

/* End of file languages_model.php */
/* Location: ./application/modules/admin/models/languages_model.php */